How to Fix RuntimeError: Event Loop is Closed When Using Pytest with FastAPI